<?php
namespace app\product\model;
use app\common\library\Model;

class Product extends Model
{
    protected $append = [
        //'question_template_info'
    ];

    protected $type = [

    ];


    /**
     * 获取初核问卷模板
     * @param $value
     * @param $data
     * @return mixed
     */
    public function getQuestionTemplateInfoAttr($value, $data) {
        $question_template_id = $data['question_template_id'];
        if($question_template_id) {
            return model('product/question_template')->find($question_template_id);
        }
        return false;
    }

    /**
     * 获取资料模板内容
     * @param string $value
     * @param array $data
     * @return mixed
     */
    public function getProfileTemplateInfoAttr($value, $data = []) {
        $profile_template_id = $data['profile_template_id'];
        if($profile_template_id) {
            return model('product/profile_template')->find($profile_template_id);
        }
        return false;
    }
}